import request from "@/utils/request.js";
const baseUrl = '/cloud-sys-service'


// 开始考试
export function startExam(params) {
    return request({
        url: baseUrl + '/exam-paper/start-exam',
        method: 'get',
        params
    })
}

// 获取考题
export function getExamById(examId) {
    return request({
        url: baseUrl + `/exam-template/getById?id=${examId}`,
        method: 'get',
    })
}

// 答题(一题一题)
export function answerQuestion(data) {
    return request({
        url: baseUrl + `/exam-paper-submit/answer-question`,
        method: 'post',
        data
    })
}

// 交卷
export function submitPaper(params) {
    return request({
        url: baseUrl + `/exam-paper-submit/submit-paper`,
        method: 'get',
        params
    })
}

// 查询考试成绩
export function getPaperById(id) {
    return request({
        url: baseUrl + `/exam-paper/getById?id=${id}`,
        method: 'get',
    })
}

// 获取试卷答题内容
export function getSubmitAnswersByPaperId(paperId) {
    return request({
        url: baseUrl + `/exam-paper-submit/getSubmitAnswersByPaperId?paperId=${paperId}`,
        method: 'get',
    })
}
